const list = [
  {
    id: "154",
    versionId: "1",
    svcName: "服务111",
    ifType: "resut",
    orgName: "财政局",
    memo: "无",
    versionNum: "2",
    auditSts: "已审核",
    auditDate: "2022/10/10 22:22",
    onlineSts: "上线",
    updateDate: "2022/10/10 22:22",
  },
  {
    id: "154",
    versionId: "2",
    svcName: "服务222",
    ifType: "resut",
    orgName: "财政局",
    memo: "无",
    versionNum: "1",
    auditSts: "已审核",
    auditDate: "2022/10/10 22:22",
    onlineSts: "上线",
    updateDate: "2022/10/10 22:22",
  },
];

const deatil = {
  ifParam: {
    adptIfCfgHttp: {
      id: "1",
      ifUrl: "/test",
      inParamsFormat: "FORMDATA",
      srcId: "1",
      httpMethod: "GET",
      callTimeout: 3000,
      createDate: null,
      updateDate: null,
      versionId: "1",
      inParamsJson:
        '{"header":[{"key":"sfz","value":"id","testValue":"3303"},{"key":"sfz","value":"id","testValue":"3303"}],"queryParam":[{"key":"sfz2","value":"id","testValue":"3303"},{"key":"sfz3","value":"id","testValue":"3303"}],"body":[{"key":"sfz","value":"id","testValue":"3303"},{"key":"sfz4","value":"id","testValue":"3303"}]}',
    },
  },
  ifType: "HTTP",
  svc: {
    svcId: "1",
    callTimeout: 3000,
    httpMethod: "GET",
    orgId: "1",
    svcName: "新服务1",
    svcUrl: "/test",
    areaCode: "330302",
    memo: "备注",
    degradePolicy: null,
    orgName: null,
    tags: null,
    svcNodeList: ["192.168.1.1", "192.168.1.2"],
  },
  inParamsList: [
    {
      paramName: "name",
      paramNameCn: "姓名",
      defaultValue: "张三",
      displayOrder: 1,
    },
    {
      paramName: "sfz",
      paramNameCn: "身份证",
      defaultValue: "33321",
      displayOrder: 1,
    },
  ],
  outParamsList: [],
  versionList:[{auditSts:"上线",versionId:"212",versionNum:"1"},{auditSts:"上线",versionId:"221",versionNum:"2"}]
};

export default [
  // getModules
  // 未审核
  {
    url: "/svc/unaudited/version",
    method: "get",
    response: ({ body }) => {
      return {
        status: 200,
        data: {
          list: list,
          total: list.length,
        },
      };
    },
  },
  // 已审核
  {
    url: "/svc",
    method: "get",
    response: ({ body }) => {
      return {
        status: 200,
        data: {
          list: list,
          total: list.length,
        },
      };
    },
  },
  // // 服务保存
  {
    url: "/svc",
    method: "post",
    response: ({ body }) => {
      return {
        status: 200,
        data: {},
      };
    },
  },
  // 详情
  {
    url: "/svc/154/1",
    method: "get",
    response: ({ body }) => {
      return {
        status: 200,
        data: deatil,
      };
    },
  },
  {
    url: "/svc/154/2",
    method: "get",
    response: ({ body }) => {
      return {
        status: 200,
        data: deatil,
      };
    },
  },
  //  上线下线
  {
    url: "/svc/154/ud",
    method: "put",
    response: ({ body }) => {
      return {
        status: 200,
        data: {},
        msg: "上下线成功",
      };
    },
  },
  //  提交
  {
    url: "/svc/version/submit",
    method: "post",
    response: ({ body }) => {
      return {
        status: 200,
        data: {},
        msg: "提交成功",
      };
    },
  },
  //  暂存
  {
    url: "/svc/version/save",
    method: "post",
    response: ({ body }) => {
      return {
        status: 200,
        data: {},
        msg: "暂存成功",
      };
    },
  },
  // 调用
  {
    url: "/svc/version/call",
    method: "post",
    response: ({ body }) => {
      return {
        status: 200,
        data: {
          data1: {
            sites: [
              { name: "菜鸟教程111", url: "www.runoob.com" },
              { name: "google111", url: "www.google.com" },
              { name: "微博111", url: "www.weibo.com" },
            ],
          },
          data2: {
            sites: [
              { name: "菜鸟教程222", url: "www.runoob.com" },
              { name: "google222", url: "www.google.com" },
              { name: "微博222", url: "www.weibo.com" },
            ],
          },
        },
        msg: "调用成功",
      };
    },
  },
  // 发送接口测试
  {
    url: "/svc/version/ifcall",
    method: "post",
    response: ({ body }) => {
      return {
        status: 200,
        data: [{ name: "JSON", address: "北京市西城区", age: 25 },{ name: "JSON", address: "北京市西城区", age: 25 }],
        msg: "操作成功",
      };
    },
  },
  // 作废服务版本
  {
    url: "/svc/version/212/abolish",
    method: "put",
    response: ({ body }) => {
      return {
        status: 200,
        data: {},
        msg: "操作成功",
      };
    },
  },
  // 调用测试某版本的服务
  {
    url: "/svc/version/call",
    method: "post",
    response: ({ body }) => {
      return {
        status: 200,
        data: [{ name: "JSON", address: "北京市西城区", age: 25 },{ name: "JSON", address: "北京市西城区", age: 25 }],
        msg: "操作成功",
      };
    },
  },
  // 标准化接口
  {
    url: "/svc/standard",
    method: "post",
    response: ({ body }) => {
      return {
        status: 200,
        data: [{ name: "JSON", address: "北京市西城区", age: 25 },{ name: "JSON", address: "北京市西城区", age: 25 }],
        msg: "操作成功",
      };
    },
  },
  {
    url: "/svc/154",
    method: "put",
    response: ({ body }) => {
      return {
        status: 200,
        data: {},
      };
    },
  },
  {
    url: "/file/update",
    method: "post",
    response: ({ body }) => {
      return {
        status: 200,
        data: {
          url:"sdk/sdk.jar"
        },
      };
    },
  },
];
